<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>CompConv卷积让模型不丢精度还可以提速 | 集智书童</title><meta name="keywords" content="神经网络"><meta name="author" content="ChaucerG"><meta name="copyright" content="ChaucerG"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="为了降低CNN的计算成本，本文提出了一种新的卷积设计：它利用分治法策略来简化特征图的转换。即插即用！可直接替换普通卷积，几乎不牺牲性能，极致压缩CNN结构！">
<meta property="og:type" content="article">
<meta property="og:title" content="CompConv卷积让模型不丢精度还可以提速">
<meta property="og:url" content="https://chaucerg.github.io/2021/07/30/CompConv%E5%8D%B7%E7%A7%AF%E8%AE%A9%E6%A8%A1%E5%9E%8B%E4%B8%8D%E4%B8%A2%E7%B2%BE%E5%BA%A6%E8%BF%98%E5%8F%AF%E4%BB%A5%E6%8F%90%E9%80%9F/index.html">
<meta property="og:site_name" content="集智书童">
<meta property="og:description" content="为了降低CNN的计算成本，本文提出了一种新的卷积设计：它利用分治法策略来简化特征图的转换。即插即用！可直接替换普通卷积，几乎不牺牲性能，极致压缩CNN结构！">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://chaucerg.github.io/img/achieve_img.jpg">
<meta property="article:published_time" content="2021-07-30T09:09:43.000Z">
<meta property="article:modified_time" content="2021-08-28T15:22:00.628Z">
<meta property="article:author" content="ChaucerG">
<meta property="article:tag" content="神经网络">
<meta property="article:tag" content="CNN">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://chaucerg.github.io/img/achieve_img.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://chaucerg.github.io/2021/07/30/CompConv%E5%8D%B7%E7%A7%AF%E8%AE%A9%E6%A8%A1%E5%9E%8B%E4%B8%8D%E4%B8%A2%E7%B2%BE%E5%BA%A6%E8%BF%98%E5%8F%AF%E4%BB%A5%E6%8F%90%E9%80%9F/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: true,
    post: true
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":50,"languages":{"author":"作者: ChaucerG","link":"链接: ","source":"来源: 集智书童","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'CompConv卷积让模型不丢精度还可以提速',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-08-28 23:22:00'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">2</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">2</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">1</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-map-signs"></i><span> 目录</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fas fa-coffee"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/img/achieve_img.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">集智书童</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-map-signs"></i><span> 目录</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fas fa-coffee"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">CompConv卷积让模型不丢精度还可以提速</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-07-30T09:09:43.000Z" title="发表于 2021-07-30 17:09:43">2021-07-30</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-08-28T15:22:00.628Z" title="更新于 2021-08-28 23:22:00">2021-08-28</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="CompConv卷积让模型不丢精度还可以提速"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><br>
<p><img src="https://gitee.com/chaucerg/pic_-web/raw/master/images/1.png" alt=""></p>
<blockquote>
<p>为了降低CNN的计算成本，本文提出了一种新的卷积设计：<strong>CompConv</strong>。它利用分治法策略来简化特征图的转换。即插即用！可直接替换普通卷积，几乎不牺牲性能，极致压缩CNN结构！<br><strong>作者单位</strong>：浙江大学, 香港中文大学</p>
</blockquote>
<h2 id="简介">简介</h2>
<p>卷积神经网络(CNN)在各种计算机视觉任务中取得了显著的成功，但其也依赖于巨大的计算成本。为了解决这个问题，现有的方法要么压缩训练大规模模型，要么学习具有精心设计的网络结构的轻量级模型。在这项工作中，作者仔细研究了卷积算子以减少其计算负载。特别是，本文提出了一个紧凑的卷积模块，称为<strong>CompConv</strong>，以促进高效的特征学习。通过分治法的策略，CompConv能够节省大量的计算和参数来生成特定维度的特征图。</p>
<p><img src="https://files.mdnice.com/user/3026/60523870-7c25-4541-8c60-a53b0089ebd7.png" alt=""></p>
<p>此外，CompConv将输入特征集成到输出中以有效地继承输入信息。更重要的是<strong>CompConv是一个即插即用模块</strong>，可以直接应用于CNN结构，无需进一步设计即可替换普通卷积层。大量的实验结果表明，CompConv可以充分压缩baseline CNN结构，同时几乎不牺牲性能。</p>
<h4 id="本文主要贡献">本文主要贡献</h4>
<ul>
<li>提出了一种紧凑的卷积模块<strong>CompConv</strong>，它利用了分治法策略和精心设计的相同映射大大降低了CNN的计算代价。</li>
<li>通过研究递归计算对学习能力的影响，对所提出的CompConv进行了详尽的分析。进一步提出了一个切实可行的压缩率控制方案。</li>
<li>作为传统卷积层的方便替代作者将CompConv应用于各种benchmark。结果表明，CompConv可以大幅节省计算负载，但几乎不牺牲模型在分类和检测任务上的性能的情况下，CompConv方法优于现有的方法。</li>
</ul>
<h2 id="本文方法">本文方法</h2>
<h3 id="2-1-动机何在？">2.1 动机何在？</h3>
<p>卷积可以被视为一种将特征从一个空间映射到另一个空间的操作。在某种程度上，这个过程类似于离散傅里叶变换(DFT)，将信号序列从时域映射到频域。快速傅里叶变换(FFT)被广泛用于提高DFT的计算速度。所以本文通过分治策略来压缩普通的卷积模块：CompConv。</p>
<p>回顾一下FFT的公式。在时域对$N-points$ 个信号序列$x(t)$进行DFT时，FFT提出将其分割成2个$\frac{N}{2}-points$个子序列，分别记为$x^{(e)}(t)$和$x^{(o)}(t)$，并对每个子序列进行DFT。这里$e$和$o$分别代表“偶”和“奇”。据此，由中间变换结果$X^{(e)}(k)$和$X^{(o)}(k)$得到频域的最终结果$X(k)$:</p>
<p><img src="https://files.mdnice.com/user/3026/f7268cd2-8b47-4fa0-819a-95a51ef1ea0d.png" alt=""></p>
<p>其中$W^k_N=exp(−j\frac{2\pi}{N}k)$是一个乘数。在此基础上，可将分解后的结果$X^{(e)}(k)$和$X^{(o)}(k)$进一步划分为更小的分组，形成递归计算的方式。</p>
<h3 id="2-2-CompConv核心单元">2.2 CompConv核心单元</h3>
<p><img src="https://files.mdnice.com/user/3026/3b77056f-cceb-429d-89f5-3aa4dc566a06.png" alt=""></p>
<p>在FFT的启发下，作者将分治策略引入到卷积模块中以提高其计算效率。通过类比，将由CNN生成的中间特征映射视为通道轴的序列。更具体地说，要开发带有C通道的特性映射$X$，可以选择开发2个特性映射$X_A$和$X_B$，每个特性映射都使用$\frac{C}{2}$个通道，然后将它们组合在一起:</p>
<p><img src="https://files.mdnice.com/user/3026/80fe88d5-e24d-434b-8781-cf337b5ce79a.png" alt=""></p>
<p>其中+表示沿通道轴的拼接操作，W是用于变换特征映射的可学习参数。</p>
<p>上式体现了CompConv的核心思想。具体来说，CompConv的核心单元由2部分实现，如图2所示。其中一个部分(即$X_A$)从输入通道的子集完全映射过来，它能够轻松地从输入中继承信息。另一部分(即$X_B$)通过卷积模块从输入特征转化而来。</p>
<h3 id="2-3-递归计算">2.3 递归计算</h3>
<p>根据式(2)中的公式，将$X_B$进一步分解为2部分，可递归计算出CompConv：</p>
<p><img src="https://files.mdnice.com/user/3026/875ab628-09eb-4e4d-98a7-7df691b1937c.png" alt=""></p>
<p>其中d为递归深度。</p>
<h4 id="Tailing-Channels">Tailing Channels</h4>
<p>将第1个分离步骤${X_{A_0},X_{B_0}}$与其他步骤区别对待，如图2所示。具体来说，$X_{A_0}$不是直接从输入中来的，而是从$X_{B_0}$转化而来的。</p>
<p>这样做主要有2个原因:</p>
<ul>
<li>
<p>一方面，在所有相同的部件${ X_{A_i} }^{d-1}<em>{i=0}$中，$X</em>{A_0}$的通道最多。如果直接将一些输入通道复制为$X_{A_0}$，那么输入特征映射和输出特征映射之间会有过多的冗余，严重限制了该模块的学习能力。</p>
</li>
<li>
<p>另一方面，除了从$X_{B_0}$转换之外，还有一些其他方法可以获得$X_{A_0}$，例如从整个输入特征映射或构建另一个递归。其中，从$X_{B_0}$开发$X_{A_0}$是计算成本最低的一种方法。同时，$X_{B_0}$的推导已经从输入特征中收集了足够的信息，因此学习能力也可以保证。</p>
</li>
</ul>
<h4 id="整合递归结果">整合递归结果</h4>
<p>为了更好地利用递归过程中的计算，最终的输出不仅通过分组两个最大的子特征得到${X_{A_0},X_{B_0}}$，并综合了所有中间结果，如图2所示。这样就可以充分利用所有的计算操作来产生最终的输出。此外，在这些特征映射的连接之后会添加一个shuffle block。</p>
<h3 id="2-4-Adaptive-Separation策略">2.4 Adaptive Separation策略</h3>
<p>CompConv采用分治策略进行高效的特征学习。因此，如何对通道进行递归分割是影响通道计算效率和学习能力的关键。这里分别用$C_{in}$和$C_{out}$表示输入通道数和输出通道数。$C_{prim}$为图2中d=3时最小计算单元的通道数，如$X_{B_0}$。考虑到递归计算过程中通道数的指数增长，可以预期：</p>
<p><img src="https://files.mdnice.com/user/3026/906783b1-f1e9-4093-a888-9368f60c3a3e.png" alt=""></p>
<p>可以很容易得到以下结果：</p>
<p><img src="https://files.mdnice.com/user/3026/8ba0e960-3ae5-4123-a2e2-3ae3a50e0428.png" alt=""></p>
<p>其中[]表示使$C_{prim}$为整数的上限函数。如果所有单元的通道之和大于$C_{out}$，就简单地放入最后一些通道$X_{A_0}$以确保输出特征具有适当的尺寸。</p>
<h4 id="递归计算深度的选择">递归计算深度的选择</h4>
<p>由式(5)可知$C_{prim}$高度依赖于递归深度d，这是CompConv模块中的一个超参数。较大的d对应较高的压缩率，其中d=0表示没有压缩。针对现代神经网络不同的结构和不同的模型尺度，作者提出了一种自适应的深度选择策略：</p>
<p><img src="https://files.mdnice.com/user/3026/2ccad8fd-ad7d-4ec0-9129-f69de417fb26.png" alt=""></p>
<p>在这里，$C_0$是一个特定于模型的设计选择，由目标压缩率和模型大小决定（[32;64;128;256;512;···]）。从直觉上看，$C_0$越大，d越小，压缩越轻。从这个角度来看，$C_0$可以用来控制计算效率和学习能力之间的权衡。</p>
<p>值得注意的是，<strong>递归深度d与Eq.(6)中输入通道的数量$C_{in}$有关，这意味着自适应策略会在不同层动态调整计算深度。同时，为了保证最小单元有足够的学习能力，要给它分配了足够的通道</strong>。换句话说，$C_{prim}$不能太小。从Eq.(5)可以看出，当d=3时，$C_{prim}$只占输出通道的约8%。因此，作者将深度d限定为最大值3。</p>
<h4 id="推荐配置">推荐配置</h4>
<p>对于最受欢迎的CNN网络，如VGG和ResNet，建议设置$C_0$=128。作者将此配置表示为<strong>CompConv128</strong>。</p>
<h3 id="2-5-复杂度分析">2.5 复杂度分析</h3>
<p>假设输入和输出特征图的分辨率都是H×W，那么普通卷积和CompConv的计算复杂度分别是：</p>
<p><img src="https://files.mdnice.com/user/3026/77da1cbf-b8a8-4c64-86e3-948d5c910782.png" alt=""></p>
<p>其中k为卷积核的大小。</p>
<p>在$C_{in}=C_{out}$和d=3的配置下，与传统卷积相比，CompConv只需要约20%的计算资源就可以开发具有相同通道数的输出特征。</p>
<h2 id="实验">实验</h2>
<h3 id="3-1-ImageNet分类">3.1 ImageNet分类</h3>
<p><img src="https://files.mdnice.com/user/3026/1f1edb14-4cb0-49bd-bf77-fc2d1b11602f.png" alt=""></p>
<p>模型结构为使用CompConv替换普通CNN的ResNet50模型，实验结果如下：</p>
<p><img src="https://files.mdnice.com/user/3026/af1544fa-0d71-4bb4-96ac-41777c797771.png" alt=""></p>
<p>可以看出，性价比很高的！！！</p>
<h3 id="3-2-COCO目标检测">3.2 COCO目标检测</h3>
<p><img src="https://files.mdnice.com/user/3026/17c0957e-6ac9-4cfa-a6f7-958cf3402506.png" alt=""></p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> torch</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">normalize</span>(<span class="params">nparray, order=<span class="number">2</span>, axis=<span class="number">0</span></span>):</span></span><br><span class="line">    <span class="string">&quot;&quot;&quot;Normalize a N-D numpy array along the specified axis.&quot;&quot;&quot;</span></span><br><span class="line">    norm = np.linalg.norm(nparray, <span class="built_in">ord</span>=order, axis=axis, keepdims=<span class="literal">True</span>)</span><br><span class="line">    <span class="keyword">return</span> nparray / (norm + np.finfo(np.float32).eps)</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">normalize</span>(<span class="params">nparray, order=<span class="number">2</span>, axis=<span class="number">0</span></span>):</span></span><br><span class="line">    <span class="string">&quot;&quot;&quot;Normalize a N-D numpy array along the specified axis.&quot;&quot;&quot;</span></span><br><span class="line">    norm = np.linalg.norm(nparray, <span class="built_in">ord</span>=order, axis=axis, keepdims=<span class="literal">True</span>)</span><br><span class="line">    <span class="keyword">return</span> nparray / (norm + np.finfo(np.float32).eps)</span><br></pre></td></tr></table></figure>
<h2 id="参考">参考</h2>
<p>[1].CompConv: A Compact Convolution Module for Efficient Feature Learning<br></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">ChaucerG</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://chaucerg.github.io/2021/07/30/CompConv%E5%8D%B7%E7%A7%AF%E8%AE%A9%E6%A8%A1%E5%9E%8B%E4%B8%8D%E4%B8%A2%E7%B2%BE%E5%BA%A6%E8%BF%98%E5%8F%AF%E4%BB%A5%E6%8F%90%E9%80%9F/">https://chaucerg.github.io/2021/07/30/CompConv%E5%8D%B7%E7%A7%AF%E8%AE%A9%E6%A8%A1%E5%9E%8B%E4%B8%8D%E4%B8%A2%E7%B2%BE%E5%BA%A6%E8%BF%98%E5%8F%AF%E4%BB%A5%E6%8F%90%E9%80%9F/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://chaucerg.github.io" target="_blank">集智书童</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C/">神经网络</a><a class="post-meta__tags" href="/tags/CNN/">CNN</a></div><div class="post_share"><div class="social-share" data-image="/img/achieve_img.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-full"><a href="/2021/07/30/hello-world/"><img class="prev-cover" src="/img/achieve_img.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Hello World</div></div></a></div></nav><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="gitalk-container"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/avatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">ChaucerG</div><div class="author-info__description">干就完了！</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">2</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">2</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">1</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/ChaucerG"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/ChaucerG" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:chaucer_g@126.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="/img/weixin.jpg" target="_blank" title="Wechat"><i class="fab fa-weixin"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">更多内容可以关注【集智书童】公众号和【集智书童】知识星球，获取原创文章以及项目源码 ~</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AE%80%E4%BB%8B"><span class="toc-text">简介</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%9C%AC%E6%96%87%E4%B8%BB%E8%A6%81%E8%B4%A1%E7%8C%AE"><span class="toc-text">本文主要贡献</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9C%AC%E6%96%87%E6%96%B9%E6%B3%95"><span class="toc-text">本文方法</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#2-1-%E5%8A%A8%E6%9C%BA%E4%BD%95%E5%9C%A8%EF%BC%9F"><span class="toc-text">2.1 动机何在？</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-2-CompConv%E6%A0%B8%E5%BF%83%E5%8D%95%E5%85%83"><span class="toc-text">2.2 CompConv核心单元</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-3-%E9%80%92%E5%BD%92%E8%AE%A1%E7%AE%97"><span class="toc-text">2.3 递归计算</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#Tailing-Channels"><span class="toc-text">Tailing Channels</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%95%B4%E5%90%88%E9%80%92%E5%BD%92%E7%BB%93%E6%9E%9C"><span class="toc-text">整合递归结果</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-4-Adaptive-Separation%E7%AD%96%E7%95%A5"><span class="toc-text">2.4 Adaptive Separation策略</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%80%92%E5%BD%92%E8%AE%A1%E7%AE%97%E6%B7%B1%E5%BA%A6%E7%9A%84%E9%80%89%E6%8B%A9"><span class="toc-text">递归计算深度的选择</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8E%A8%E8%8D%90%E9%85%8D%E7%BD%AE"><span class="toc-text">推荐配置</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-5-%E5%A4%8D%E6%9D%82%E5%BA%A6%E5%88%86%E6%9E%90"><span class="toc-text">2.5 复杂度分析</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%9E%E9%AA%8C"><span class="toc-text">实验</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#3-1-ImageNet%E5%88%86%E7%B1%BB"><span class="toc-text">3.1 ImageNet分类</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-2-COCO%E7%9B%AE%E6%A0%87%E6%A3%80%E6%B5%8B"><span class="toc-text">3.2 COCO目标检测</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%82%E8%80%83"><span class="toc-text">参考</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2021/07/30/CompConv%E5%8D%B7%E7%A7%AF%E8%AE%A9%E6%A8%A1%E5%9E%8B%E4%B8%8D%E4%B8%A2%E7%B2%BE%E5%BA%A6%E8%BF%98%E5%8F%AF%E4%BB%A5%E6%8F%90%E9%80%9F/" title="CompConv卷积让模型不丢精度还可以提速"><img src="/img/achieve_img.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="CompConv卷积让模型不丢精度还可以提速"/></a><div class="content"><a class="title" href="/2021/07/30/CompConv%E5%8D%B7%E7%A7%AF%E8%AE%A9%E6%A8%A1%E5%9E%8B%E4%B8%8D%E4%B8%A2%E7%B2%BE%E5%BA%A6%E8%BF%98%E5%8F%AF%E4%BB%A5%E6%8F%90%E9%80%9F/" title="CompConv卷积让模型不丢精度还可以提速">CompConv卷积让模型不丢精度还可以提速</a><time datetime="2021-07-30T09:09:43.000Z" title="发表于 2021-07-30 17:09:43">2021-07-30</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/07/30/hello-world/" title="Hello World"><img src="/img/achieve_img.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hello World"/></a><div class="content"><a class="title" href="/2021/07/30/hello-world/" title="Hello World">Hello World</a><time datetime="2021-07-30T08:31:44.973Z" title="发表于 2021-07-30 16:31:44">2021-07-30</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('/img/achieve_img.jpg')"><div id="footer-wrap"><div class="copyright">&copy;2021 By ChaucerG</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Welcome to my CHANNEL!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (true){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><script src="/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>if (!window.MathJax) {
  window.MathJax = {
    tex: {
      inlineMath: [ ['$','$'], ["\\(","\\)"]],
      tags: 'ams'
    },
    chtml: {
      scale: 1.2
    },
    options: {
      renderActions: {
        findScript: [10, doc => {
          for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
            const display = !!node.type.match(/; *mode=display/)
            const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
            const text = document.createTextNode('')
            node.parentNode.replaceChild(text, node)
            math.start = {node: text, delim: '', n: 0}
            math.end = {node: text, delim: '', n: 0}
            doc.math.push(math)
          }
        }, ''],
        insertScript: [200, () => {
          document.querySelectorAll('mjx-container:not\([display]\)').forEach(node => {
            const target = node.parentNode
            if (target.nodeName.toLowerCase() === 'li') {
              target.parentNode.classList.add('has-jax')
            } else {
              target.classList.add('has-jax')
            }
          });
        }, '', false]
      }
    }
  }
  
  const script = document.createElement('script')
  script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
  script.id = 'MathJax-script'
  script.async = true
  document.head.appendChild(script)
} else {
  MathJax.startup.document.state(0)
  MathJax.texReset()
  MathJax.typeset()
}</script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"><script src="https://cdn.jsdelivr.net/npm/katex@latest/dist/contrib/copy-tex.min.js"></script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/katex@latest/dist/contrib/copy-tex.css"><script>(() => {
  document.querySelectorAll('#article-container span.katex-display').forEach(item => {
    btf.wrap(item, 'div', { class: 'katex-wrap'})
  })
})()</script><script>function addGitalkSource () {
  const ele = document.createElement('link')
  ele.rel = 'stylesheet'
  ele.href= 'https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css'
  document.getElementsByTagName('head')[0].appendChild(ele)
}

function loadGitalk () {
  function initGitalk () {
    var gitalk = new Gitalk(Object.assign({
      clientID: 'c2f87403b1eb48242fd0',
      clientSecret: 'e687d315a31a49ded4c3ba590bf12ff20ecc118c',
      repo: 'https://github.com/ChaucerG/chaucerg.github.io',
      owner: 'https://github.com/ChaucerG',
      admin: ['ChaucerG'],
      id: 'fafeaa0b4cf039a1a7f35ba01675c85a',
      language: 'zh-CN',
      perPage: 10,
      distractionFreeMode: false,
      pagerDirection: 'last',
      createIssueManually: false,
      updateCountCallback: commentCount
    },null))

    gitalk.render('gitalk-container')
  }

  if (typeof Gitalk === 'function') initGitalk()
  else {
    addGitalkSource()
    getScript('https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js').then(initGitalk)
  }
}

function commentCount(n){
  let isCommentCount = document.querySelector('#post-meta .gitalk-comment-count')
  if (isCommentCount) {
    isCommentCount.innerHTML= n
  }
}

if ('Gitalk' === 'Gitalk' || !true) {
  if (true) btf.loadComment(document.getElementById('gitalk-container'), loadGitalk)
  else loadGitalk()
} else {
  function loadOtherComment () {
    loadGitalk()
  }
}</script></div><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>